<?php
class SetLinkSort extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$lid = irqst ( 'lid' );
		$sort = irqst ( 'sort' );
		$data ['success'] = false;
		if (empty ( $lid )) {
			$data ['msg'] = '非法的友情链接编号';
		} else {
			$linkM = new WebLinkModel ();
			$rst = $linkM->update ( array ('sort' => $sort ), $lid );
			if ($rst !== false) {
				$data ['success'] = true;
			} else {
				$data ['msg'] = '出错啦:' . $linkM->last_error_msg ();
			}
		}
		return new JsonView ( $data );
	}
}